<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::prefix('api')->group(function() {
    /**
     * 用户信息
     */
    //获取openid
    Route::get('/openid', 'UserController@getOpenid');
    //注册登录
    Route::post('/login','UserController@login');
    //用户信息
    Route::get('/user','UserController@userInfo');
    //发送验证码
    Route::post('/sms','UserController@sendSms');
    //绑定电话
    Route::post('/bind','UserController@userBindPhone');
    //我的客户
    Route::get('/customer','UserController@myNextUser');

    /**
     * 收货地址
     */
    //默认地址
    Route::get('/address/selected','AddressController@selected');
    //地址列表
    Route::get('/address/list','AddressController@list');
    //添加地址
    Route::post('/address/add','AddressController@add');
    //编辑地址
    Route::post('/address/edit','AddressController@edit');
    //删除地址
    Route::get('/address/delete','AddressController@delete');
    //设置默认收货地址
    Route::get('/address/default','AddressController@default');

    /**
     * 首页信息
     */
    //轮播图
    Route::get("/home/banner",'ApiController@banner');

    /**
     * 系统
     */
    //过审状态
    Route::get('/open','ApiController@openApi');


    /**
     * 商品信息
     */
    //商品分类
    Route::get("/goods/class",'GoodsController@goodsClassList');
    //商品列表
    Route::get("/goods/list",'GoodsController@goodsList');
    //商品详情
    Route::get("/goods/detail",'GoodsController@goodsDetail');
    //评价
    Route::get("/goods/eavluate","GoodsController@goodsEavluate");

    /**
     * 收藏
     */
    //收藏
    Route::any("/collect/add",'CollectController@collectAdd');
    //收藏列表
    Route::any("/collect/list",'CollectController@collectList');


    /**
     * 购物车
     */
    //加入购物车
    Route::post("/shopcar/add",'ShopcarController@shopcarAdd');
    //删除购物车
    Route::get("/shopcar/delete",'ShopcarController@shopcarDelete');
    //修改购物车数量
    Route::post("/shopcar/update",'ShopcarController@shopcarUpdate');
    //购物车数据
    Route::get("/shopcar/list",'ShopcarController@goodscarList');
    //选中购物车
    Route::post("/shopcar/selected",'ShopcarController@shopCarSelected');
    //结算
    Route::get("/shopcar/js",'ShopcarController@shopCarSettlement');

    /**
     * 充值套餐
     */
    //充值套餐列表
    Route::get("/recharge/list","RechargeController@rechargeListApi");
    //充值
    Route::post("/recharge/pay","RechargeController@rehargeOrderApi");

    /**
     * 活动
     */
    //活动列表
    Route::get("/activity/list","RechargeController@activityApi");

    /**
     * 订单
     */
    //购物车购买（下单并支付）
    Route::post("/order/add","OrderController@orderAddApi");
    //立即购买(下单并支付)
    Route::post("/order/buy","OrderController@orderBuyApi");
    //再次支付
    Route::post("/order/pay","OrderController@orderPayApi");
    //订单列表
    Route::any("/order/list","OrderController@orderListApi");
    //取消订单
    Route::post("/order/close","OrderController@orderCloseApi");
    //确认收货
    Route::post("/order/receipt","OrderController@orderConfirmReceipt");
    //退款
    Route::post("/order/refund","OrderController@orderRefundApi");
    //支付回调
    Route::any("/notify","PayController@notify");
    //退款回调
    Route::any("/refund","payController@refund");
    //评价(文字)
    Route::post("/order/pingjia/add","OrderController@orderPingjia");
    //评价(图片)
    Route::post("/order/pingjia/upload","OrderController@orderPingjiaImage");
    /**
     * 积分中心
     */
    //积分列表
    Route::post("/bill/list","BillController@userBillApi");
    //充值记录
    Route::get("/bill/recharge/list","BillController@billRechargeRecordsApi");
});
